"use strict";

exports.__esModule = true;
exports.empty = empty;
exports.mapAddKey = mapAddKey;
function empty(arr) {
    return !arr || arr.length < 1;
}

/**
 * 快捷复制Arr每个item一个p到p
 * 
 * @param {Array} arr 
 * @param {String} from 
 * @param {String} to 
 */
function mapAddKey(arr, from, to) {
    if (!Array.isArray(arr)) {
        return [];
    }
    return arr.map(function (v) {
        v[to] = v[from];
        return v;
    });
}